#include<stdio.h>
#include<string.h>
int main()
{
    char ch[5000];
    gets(ch);

    int sz = strlen(ch)-1;
    int i = 0;
    while (ch[sz] != ' ')
    {
        i++;

        sz--;

        if (sz == 0)
           {i++;
            break;
           }
    }

    printf("%d", i);
    return 0;
}